
		local depvar "shf"
		local cluslvl "id_mills"

use "$dataDir/dataset_fires_harvest_daily_weather", clear


		
*Column 1: Base specification		
	foreach var in `depvar'{

	reghdfe `var' afterXtreatment temp_celsius rain rain2, abs(id_mills i.year#i.month) vce(cluster `cluslvl')
		estimates store `var'_treat_did_wc
		qui sum `var' if e(sample)==1 & year<2015
		local mean1=r(mean)
		estadd scalar mean1 `mean1' : `var'_treat_did_wc
		estadd local moyearfe "Yes"
		estadd local millfe "Yes"	
		estadd local cluslvl "Mill"
		estadd local wc "Yes"
	}	
	
	

*Column 2: Bootstrap		
	foreach var in `depvar'{
		areg `var'  afterXtreatment i.year#i.month temp_celsius rain rain2, abs(id_mills)  vce(bootstrap, strata(id_mills))
		estimates store `var'_treat_did_bootstrap
		qui sum `var' if e(sample)==1 & year<2015
		local mean1=r(mean)
		estadd scalar mean1 `mean1' : `var'_treat_did_bootstrap
		estadd local moyearfe "Yes"
		estadd local millfe "Yes"	
		estadd local cluslvl "Bootstrap"
		estadd local wc "Yes"

	}

	
*Column 4 and 5: sample restrictions
		
	foreach var in `depvar'{
	reghdfe `var'  afterXtreatment temp_celsius rain rain2 if nom_estab!="INGENIO SAN FRANCISCO AMECA", abs(id_mills i.year#i.month) vce(cluster `cluslvl')
		estimates store `var'_treat_did_samp_rest_1
		qui sum `var' if e(sample)==1 & year<2015
		local mean1=r(mean)
		estadd scalar mean1 `mean1' : `var'_treat_did_samp_rest_1
		estadd local moyearfe "Yes"
		estadd local millfe "Yes"	
		estadd local cluslvl "Mill"
		estadd local wc "Yes"
	reghdfe `var'  afterXtreatment temp_celsius rain rain2 if nom_estab!="INGENIO EL POTRERO", abs(id_mills i.year#i.month) vce(cluster `cluslvl')
		estimates store `var'_treat_did_samp_rest_2
		qui sum `var' if e(sample)==1 & year<2015
		local mean1=r(mean)
		estadd scalar mean1 `mean1' : `var'_treat_did_samp_rest_2
		estadd local moyearfe "Yes"
		estadd local millfe "Yes"	
		estadd local cluslvl "Mill"
		estadd local wc "Yes"
	}		

*Column 3: Distribution areas

use "$dataDir/dataset_shf_distribution_areas_300_weather", clear


foreach var in `depvar'{
	reghdfe `var' afterXtreatment temp_celsius rain rain2, abs(id_mills i.year#i.month) vce(cluster `cluslvl')
		estimates store `var'_treat_did_300
		qui sum `var' if e(sample)==1 & year<2015
		local mean1=r(mean)
		estadd scalar mean1 `mean1' : `var'_treat_did_300
		estadd local moyearfe "Yes"
		estadd local millfe "Yes"	
		estadd local cluslvl "Mill"
		estadd local buffer "`d'"
		estadd local wc "Yes"
		
	}
		
*Column 6: monthly specification
use  "$dataDir/dataset_fires_harvest_monthly_weather", clear

	foreach var in `depvar'{
	reghdfe `var' afterXtreatment i.year#i.month temp_celsius rain rain2, abs(id_mills i.year#i.month) vce(cluster `cluslvl')
		estimates store `var'_treat_did_monthly
		qui sum `var' if e(sample)==1 & year<2015
		local mean1=r(mean)
		estadd scalar mean1 `mean1' : `var'_treat_did_monthly
		estadd local moyearfe "Yes"
		estadd local millfe "Yes"	
		estadd local cluslvl "Mill"
		estadd local wc "Yes"
	}

	
esttab shf_treat_did_wc shf_treat_did_bootstrap shf_treat_did_300 shf_treat_did_samp_rest_1 shf_treat_did_samp_rest_2 shf_treat_did_monthly using "$mainDir/tables/Tab2_robustness_checks.tex", replace b(%12.3fc) se(%12.3fc) keep(afterXtreatment) varlabels(afterXtreatment  "After 2015 $\times$ Regulated") mtitle(" & Benchmark & Bootstrap & Distribution & Sample & Sample & Monthly \\ & &  &areas & rest. 1 & rest. 2 & fires  ")  label starl(* 0.1 ** 0.05 *** 0.01) stats(mean1 N r2 moyearfe millfe wc cluslvl, fmt(%9.3fc %12.0fc %12.3fc) label("Pre 2015 mean" "Obs." "R-squared" "Month by year FE" "Mill FE" "Weather controls" "Cluster level")) nonotes